<h1>Listando precondicoes</h1>

<table class="novo">
  <tr>
  	<% for incen in @incentivos %>
	  	<th class="novo"><%=h incen.abreviacao %></th>
	<% end %>
    <th class="novo" align="center">Descricao</th>
    <th class="novo">Ativo</th>
    <th class="novo" colspan="3"></th>
  </tr>

<% for precondicao in @precondicoes %>
  <tr>
	<% for incen in @incentivos %>
	    <td class="novo" align="center"><input type="checkbox" disabled="true" value="<%=incen.id%>" <%if precondicao.incentivos.include? incen%>checked="checked" <% end %> /></td>
	<% end %>
    <td class="novo" style="line-height:150%;"><%=h precondicao.descricao %></td>
    <td class="novo"><%=h yes_or_no?(precondicao.ativo) %></td>
    <td class="novo"><%= link_to 'Exibir', precondicao %></td>
    <td class="novo"><%= link_to 'Alterar', edit_precondicao_path(precondicao) %></td>
    <td class="novo"><%= link_to 'Excluir', precondicao, :confirm => 'Confirma a exclusão?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'Novo(a) precondicao', new_precondicao_path %>
